Skip to content

test(server): regression reproducers for #25698#25714

Merged
kitlangton merged 1 commit intodevfrom
kit/reproducers-25698
May 4, 2026
Merged

test(server): regression reproducers for #25698#25714
kitlangton merged 1 commit intodevfrom
kit/reproducers-25698

Conversation

@kitlangton
Copy link
Copy Markdown
Contributor

What this is

Three regression tests that fail on `dev` today and lock in the contracts behind @OpeOginni's cleanup PR #25698. CI will be red until #25698 lands; this PR is meant to either be:

State on dev today

Test File Status on dev Status with #25698
strips upstream transfer-encoding header from proxied assets `httpapi-ui.test.ts` ❌ FAIL ✅ PASS
serves the PWA manifest without auth even when a server password is set `httpapi-ui.test.ts` ❌ FAIL ✅ PASS
PTY connect token requires matching directory across mint and connect `httpapi-listen.test.ts` ✅ PASS (contract-only) ✅ PASS

The third test passes on dev because the server contract is correct — strict directory scope match between mint and consume. It documents that contract so future regressions on either side (server loosening match or app stopping to send directory) get caught. It's also the smallest reproducer of the symptom @OpeOginni hit: `POST /pty/{id}/connect-token` without `?directory=` returns 404 because the PTY is registered in another instance directory than the listener's cwd.

Verification

Locally cherry-picked #25698 onto this branch and re-ran:

```
bun run test test/server/httpapi-ui.test.ts test/server/httpapi-listen.test.ts
15 pass
0 fail
53 expect() calls
```

Recommendation

Close this draft and have @OpeOginni cherry-pick `fc90986ae` into #25698. The `routes/instance/AGENTS.md` parity guidance asks for regression coverage to live with the fix:

Add or update parity coverage in `test/server/httpapi-bridge.test.ts` or the focused HttpApi tests when behavior or schema parity could regress.

If folding in is awkward for any reason, this branch can land separately after #25698.

Adds three regression tests that lock in the contracts behind Ope's
cleanup PR #25698:

1. httpapi-ui.test.ts: 'strips upstream transfer-encoding header from
   proxied assets' — fails on dev today (transfer-encoding leaks through
   the UI proxy and triggers ERR_INVALID_CHUNKED_ENCODING in browsers).

2. httpapi-ui.test.ts: 'serves the PWA manifest without auth even when a
   server password is set' — fails on dev today (auth middleware rejects
   /site.webmanifest and the web-app-manifest icons with 401, breaking
   PWA install).

3. httpapi-listen.test.ts: 'PTY connect token requires matching directory
   across mint and connect' — passes on dev (the server already enforces
   strict directory scope match), but documents the contract Ope's app fix
   relies on. Without a directory query, the server resolves the PTY in
   its own cwd and returns 404 — the symptom the app hit when calling
   client.pty.connectToken({ ptyID }) without directory.

On dev: 2 fail, 1 passes (3rd is contract-only).
With #25698 applied: 3 pass.
@kitlangton kitlangton force-pushed the kit/reproducers-25698 branch from fc90986 to b0aacad Compare May 4, 2026 13:43
@kitlangton kitlangton marked this pull request as ready for review May 4, 2026 13:43
@kitlangton kitlangton merged commit 6e9f10a into dev May 4, 2026
10 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant